<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/basic_form_style.css" rel="stylesheet" type="text/css" />
<link href="css/table_style1.css" rel="stylesheet" type="text/css" />
<script src="jquery/js/jquery-1.7.2.min.js"></script>
<style type="text/css">
.subHead{text-align:center}
</style>

<script type="text/javascript">
	function addNewEquipment()
	{			
		var equipment_name=document.getElementById('equipment_name').value;
		var description=document.getElementById('description').value;
		
		if( equipment_name=="" || description=="")
			alert("Plaese fill the fieldes !!!" +description+equipment_name); 			
		else{
			$.post("content/find_euipment_ajax.php",{act:"add",equipment_name:equipment_name, description:description},function(data){document.getElementById('toReplace').innerHTML =data;}); //document.getElementById('toReplace').innerHTML ="helloDudi";});
		}
	
	}
	
		function removeEquipment1()
	{			
		var searchEquipment=document.getElementById('searchEquipment').value;				
		if( searchEquipment=="" )
			alert("Plaese fill the fieldes !!!" ); 			
		else if( confirm("Are you sure you want to delete "+searchEquipment+"?") ){
			$.post("content/find_euipment_ajax.php",{act:"remove", searchEquipment:searchEquipment},function(data){document.getElementById('toReplace').innerHTML =data;});
		}	
	}
</script>
</head>

<body>
<center>
    <table width="724" height="340" border="0" >
      <tr>
        <td colspan="4" > <center><h1 class="primeHead">Add New Equipment</h1></center></td>
      </tr>
      <form id="form1" name="form1" method="post" action="">
          <tr>
            <td width="173" class="subHead">Equipment name:</td>
            <td width="176"><label for="first_name"></label>
            <input type="text" name="equipment_name" id="equipment_name" /></td>
            <td width="158" class="subHead">&nbsp;</td>
            <td width="199">&nbsp;</td>
          </tr>
          <tr>
            <td class="subHead">Description:</td>
            <td><input type="text" name="description" id="description" /></td>
            <td class="subHead"><input font-size:17px;" type="button" class="TriggerButton" name="addEquipment" id="addEquipment" value="  Add    Equipment  " onclick="addNewEquipment();" /></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="subHead">=====================</td>
            <td>===================</td>
            <td class="subHead">=================</td>
            <td>=====================</td>
          </tr>
          <tr>
            <td class="subHead">Search Equipment:</td>
            <td><input type="text" name="searchEquipment" id="searchEquipment" /></td>
            <td class="subHead"><input font-size:17px;="font-size:17px;"" type="button" class="TriggerButton" name="removeEquipment" id="removeEquipment" value="Remove Equipment" onclick="removeEquipment1();" /></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="subHead">=====================</td>
            <td>===================</td>
            <td class="subHead">=================</td>
            <td>=====================</td>
          </tr>
          <tr>
            <td colspan="4">&nbsp;</td>
          </tr>
      </form>
      <tr><td colspan="4">
	      <center><h1 id="toReplace">Results will be shown here</h1></center>
      </td></tr>
    </table>
</center>
</body>
</html>